package org.smart4j.plugin.security;

import org.apache.shiro.web.mgt.WebSecurityManager;
import org.apache.shiro.web.servlet.ShiroFilter;

/**
 * 安全过滤器
 *
 * Created by chinalin on 2017/3/30.
 */
public class SmartSecurityFilter extends ShiroFilter{

    @Override
    public void init() throws Exception {
        super.init();
        WebSecurityManager webSecurityManager = super.getSecurityManager();
        //设置 Realm,可同时支持多个Realm,并按照先后顺序用逗号分割
        setRealms(webSecurityManager);
        //设置 Cache,用于减少数据库查询次数，降低 I/O 访问
        setCache(webSecurityManager);
    }
    private void setRealms(WebSecurityManager webSecurityManager){
        // 读取 smart.plugin.security.realms 配置项
        String securityRealms = SecurityConfig
    }
}
